.TH "Zebulon::SICK::Laser" 3 "13 Oct 2009" "Version 2" "zebulon" \" -*- nroff -*-
.ad l
.nh
.SH NAME
Zebulon::SICK::Laser \- 
.SH SYNOPSIS
.br
.PP
.SS "Classes"

.in +1c
.ti -1c
.RI "class \fBCallback\fP"
.br
.RI "\fI\fBCallback\fP class used to register for message events. \fP"
.in -1c
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBDistanceModes\fP { \fBCM\fP =  0x00, \fBMM\fP =  0x01 }"
.br
.RI "\fIPossible distance mode settings values that the \fBSICK\fP \fBLaser\fP can use. \fP"
.ti -1c
.RI "enum \fBScanningAngle\fP { \fBOneHundred\fP =  0x6400, \fBOneEighty\fP =  0xB400 }"
.br
.RI "\fIPossible angle values that the \fBSICK\fP \fBLaser\fP can scan with. \fP"
.ti -1c
.RI "enum \fBAngularResolution\fP { \fBOne\fP =  0x6400, \fBHalf\fP =  0x3200, \fBQuarter\fP =  0x1900 }"
.br
.RI "\fIPossible angular resolution values that the \fBSICK\fP \fBLaser\fP can use. \fP"
.ti -1c
.RI "typedef std::set< \fBLaser::Callback\fP * > \fBCallbackSet\fP"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBLaser\fP ()"
.br
.RI "\fIConstructor. \fP"
.ti -1c
.RI "virtual \fB~Laser\fP ()"
.br
.RI "\fIDestructor. \fP"
.ti -1c
.RI "\fBMessages::Message\fP * \fBGetMessageFromQueue\fP ()"
.br
.RI "\fIGets next message from the queue and remove it from the queue. \fP"
.ti -1c
.RI "\fBMessages::Message\fP * \fBGetLastMessageReceived\fP () const "
.br
.RI "\fIGets a COPY of the last message received from the \fBSICK\fP LIDAR. \fP"
.ti -1c
.RI "bool \fBTransmit\fP (\fBMessages::Message\fP *message)"
.br
.RI "\fISends a \fBSICK\fP telegram message. \fP"
.ti -1c
.RI "bool \fBEstablishConnection\fP (const std::string &port='COM4', const int baud=460800, const unsigned char id=0x00, const int tries=1)"
.br
.RI "\fIConnects to the serial port of the \fBSICK\fP laser. \fP"
.ti -1c
.RI "bool \fBShutdown\fP ()"
.br
.RI "\fICleans up the state of the \fBSICK\fP \fBLaser\fP. \fP"
.ti -1c
.RI "bool \fBRequestContinuousOutput\fP (const unsigned int timeoutMs=10000)"
.br
.RI "\fISends a request for the laser to begin sending scanning output messages as soon as they are received. \fP"
.ti -1c
.RI "bool \fBStopContinuousOutput\fP (const unsigned int timeoutMs=2500)"
.br
.RI "\fISends a request to the laser to stop sending continuous output. \fP"
.ti -1c
.RI "bool \fBChangeBaudRate\fP (int baud, int cbaud=0)"
.br
.ti -1c
.RI "bool \fBSetPermanentBaudRate\fP (bool cur=true)"
.br
.ti -1c
.RI "bool \fBSetDistanceMode\fP (\fBLaser::DistanceModes\fP mode)"
.br
.RI "\fISends a request to the laser to change the distance mode. This method may take up to 8 seconds to complete because of response time from sensor. \fP"
.ti -1c
.RI "bool \fBSetScanning\fP (\fBLaser::ScanningAngle\fP angle, \fBLaser::AngularResolution\fP resolution)"
.br
.RI "\fISends a request to the laser to change the scanning angle and the angular resolution. \fP"
.ti -1c
.RI "unsigned int \fBGetQueueSize\fP () const "
.br
.RI "\fIGets the number of messages in the queue. \fP"
.ti -1c
.RI "int \fBRegisterCallback\fP (\fBLaser::Callback\fP *cb)"
.br
.RI "\fIRegister a callback to be done everytime a message is received. \fP"
.ti -1c
.RI "int \fBRemoveCallback\fP (\fBLaser::Callback\fP *cb)"
.br
.RI "\fIRemove a registered callback. \fP"
.in -1c
.SH "Member Enumeration Documentation"
.PP 
.SS "enum \fBZebulon::SICK::Laser::AngularResolution\fP"
.PP
Possible angular resolution values that the \fBSICK\fP \fBLaser\fP can use. 
.PP
\fBEnumerator: \fP
.in +1c
.TP
\fB\fIOne \fP\fP
1 Degree Resolution 
.TP
\fB\fIHalf \fP\fP
0.5 Degree Resolution 
.TP
\fB\fIQuarter \fP\fP
0.25 Degree Resolution 
.SS "enum \fBZebulon::SICK::Laser::DistanceModes\fP"
.PP
Possible distance mode settings values that the \fBSICK\fP \fBLaser\fP can use. 
.PP
\fBEnumerator: \fP
.in +1c
.TP
\fB\fICM \fP\fP
Centimeter mode. 
.TP
\fB\fIMM \fP\fP
Millimeter mode. 
.SS "enum \fBZebulon::SICK::Laser::ScanningAngle\fP"
.PP
Possible angle values that the \fBSICK\fP \fBLaser\fP can scan with. 
.PP
\fBEnumerator: \fP
.in +1c
.TP
\fB\fIOneHundred \fP\fP
100 Degree Sweep 
.TP
\fB\fIOneEighty \fP\fP
180 Degree Sweep 
.SH "Member Function Documentation"
.PP 
.SS "bool Laser::EstablishConnection (const std::string & port = \fC'COM4'\fP, const int baud = \fC460800\fP, const unsigned char id = \fC0x00\fP, const int tries = \fC1\fP)"
.PP
Connects to the serial port of the \fBSICK\fP laser. This function attempts to connect to the \fBSICK\fP laser over various baud rates If the \fBSICK\fP laser is connected at a standard baud rate of 500K, 38400, 19200 or 9600, it should be detected (in that order). You can also specify a baud rate to try first (if you think you know what baud rate to connect at, trying this one first should speed things along in the initialization)
.PP
\fBParameters:\fP
.RS 4
\fIport\fP The port to connect to 
.br
\fIbaud\fP The baud rate at which to try to connect to first (then try others) 
.br
\fItries\fP The number of tries to 'ping' the laser and wait for a response (default is 1, try more if you need it)
.RE
.PP
\fBReturns:\fP
.RS 4
1 on pass, 0 on fail. 
.RE
.PP

.SS "\fBMessage\fP * Laser::GetLastMessageReceived () const"
.PP
Gets a COPY of the last message received from the \fBSICK\fP LIDAR. \fBReturns:\fP
.RS 4
A pointer to the next message in the queue. You must delete this data! 
.RE
.PP

.SS "\fBMessage\fP * Laser::GetMessageFromQueue ()"
.PP
Gets next message from the queue and remove it from the queue. \fBReturns:\fP
.RS 4
A pointer to the next message in the queue. You must delete this data! 
.RE
.PP

.SS "unsigned int Laser::GetQueueSize () const"
.PP
Gets the number of messages in the queue. \fBReturns:\fP
.RS 4
The number of messages in the queue. 
.RE
.PP

.SS "int Laser::RegisterCallback (\fBLaser::Callback\fP * cb)"
.PP
Register a callback to be done everytime a message is received. You can register multiple callbacks if desired.
.PP
\fBParameters:\fP
.RS 4
\fIcb\fP \fBMessage\fP callback to perform when message is received.
.RE
.PP
\fBReturns:\fP
.RS 4
1 on success, 0 on failure. 
.RE
.PP

.SS "int Laser::RemoveCallback (\fBLaser::Callback\fP * cb)"
.PP
Remove a registered callback. \fBParameters:\fP
.RS 4
\fIcb\fP \fBMessage\fP callback pointer.
.RE
.PP
\fBReturns:\fP
.RS 4
1 on success, 0 on failure. 
.RE
.PP

.SS "bool Laser::RequestContinuousOutput (const unsigned int timeoutMs = \fC10000\fP)"
.PP
Sends a request for the laser to begin sending scanning output messages as soon as they are received. \fBParameters:\fP
.RS 4
\fItimeoutMs\fP The amount of time to wait for a continuous output message before returning.
.RE
.PP
\fBReturns:\fP
.RS 4
true on success, false on fail. 
.RE
.PP

.SS "bool Laser::SetDistanceMode (\fBLaser::DistanceModes\fP mode)"
.PP
Sends a request to the laser to change the distance mode. This method may take up to 8 seconds to complete because of response time from sensor. This method will only work correctly before continuous output is requested.
.PP
\fBParameters:\fP
.RS 4
\fImode\fP The new distance mode that the \fBLaser\fP will use.
.RE
.PP
\fBReturns:\fP
.RS 4
true if the message was sent. false otherwise. 
.RE
.PP

.SS "bool Laser::SetScanning (\fBLaser::ScanningAngle\fP angle, \fBLaser::AngularResolution\fP resolution)"
.PP
Sends a request to the laser to change the scanning angle and the angular resolution. This method will only work correctly before continuous output is requested.
.PP
\fBParameters:\fP
.RS 4
\fIangle\fP The new scanning angle that the \fBLaser\fP will use. 
.br
\fIresolution\fP The new angular resolution that the \fBLaser\fP will use.
.RE
.PP
\fBReturns:\fP
.RS 4
true if the message was sent. false otherwise. 
.RE
.PP

.SS "bool Laser::Shutdown ()"
.PP
Cleans up the state of the \fBSICK\fP \fBLaser\fP. This function sends a command to the laser so it stops sending continuous output messages. It also stops the message listener thread and clears/frees the messages in the message queue.
.PP
\fBReturns:\fP
.RS 4
true on pass. Currently never fails... 
.RE
.PP

.SS "bool Laser::StopContinuousOutput (const unsigned int timeoutMs = \fC2500\fP)"
.PP
Sends a request to the laser to stop sending continuous output. \fBParameters:\fP
.RS 4
\fItimeoutMs\fP How long to wait in milliseconds before timeout waiting for LMS2xx response.
.RE
.PP
\fBReturns:\fP
.RS 4
true if the message was sent. false otherwise. 
.RE
.PP

.SS "bool Laser::Transmit (\fBMessages::Message\fP * msg)"
.PP
Sends a \fBSICK\fP telegram message. \fBParameters:\fP
.RS 4
\fImsg\fP The message to send to the \fBSICK\fP laser.
.RE
.PP
\fBReturns:\fP
.RS 4
true on success, false on fail. 
.RE
.PP


.SH "Author"
.PP 
Generated automatically by Doxygen for zebulon from the source code.
